-
Notifications
You must be signed in to change notification settings - Fork 5
fix: breaking behaviour with inline tags #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cpursley
merged 1 commit into
agoodway:main
from
ejscunha:ecunha/fix-breaking-behaviour
Sep 12, 2025
Merged
fix: breaking behaviour with inline tags #13
cpursley
merged 1 commit into
agoodway:main
from
ejscunha:ecunha/fix-breaking-behaviour
Sep 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Don't add double new line after a inline tag mixed with text.
Reviewer's GuideImplement context-sensitive element spacing to avoid unnecessary double newlines after inline tags, introduce helper to differentiate block vs inline tags, and update tests and fixtures to validate inline tag behavior. Class diagram for updated Html2Markdown.Converter spacing logicclassDiagram
class Html2Markdown.Converter {
+process_children_to_iolist(children, opts)
+process_node_to_iolist(node, opts)
+process_ordered_list_item_to_iolist(other, index, opts)
+process_children_with_context(children, opts, context)
-get_spacing_between_elements(node)
}
class ElementTypes {
+block_element?(tag)
}
Html2Markdown.Converter --> ElementTypes: uses
Html2Markdown.Converter : get_spacing_between_elements(node)
Html2Markdown.Converter : process_children_to_iolist(children, opts)
Html2Markdown.Converter : process_node_to_iolist(node, opts)
Html2Markdown.Converter : process_ordered_list_item_to_iolist(other, index, opts)
Html2Markdown.Converter : process_children_with_context(children, opts, context)
ElementTypes : block_element?(tag)
Flow diagram for spacing decision between elementsflowchart TD
A["process_children_to_iolist"] --> B["get_spacing_between_elements(node)"]
B --> C{Is tag a block element?}
C -- Yes --> D["Spacing: '\n\n'"]
C -- No --> E["Spacing: ' '"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closed
Collaborator
|
Thank you @ejscunha !!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't add double new line after a inline tag mixed with text.
Summary by Sourcery
Fix spacing logic between HTML elements by replacing hard-coded newlines with context-aware spacing, add supporting tests, and update fixtures
Bug Fixes:
Enhancements:
Tests:
Chores: